package com.itheima.controller;


import com.alibaba.dubbo.config.annotation.Reference;
import com.itheima.entity.PageResult;
import com.itheima.entity.QueryPageBean;
import com.itheima.entity.Result;
import com.itheima.pojo.Order;
import com.itheima.service.OrderService;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/ordersettinglist")
public class OrderSettingListController {


    @Reference
    private OrderService orderService;

    @RequestMapping("/findPage")
    public PageResult findPage(@RequestBody QueryPageBean queryPageBean) {
        return orderService.findPage(queryPageBean);
    }

    @RequestMapping("/changeStatus")
    public Result changeStatus(Integer id){
        try {
            orderService.changeStatus(id);
            return new Result(true,"修改状态成功!");
        } catch (Exception e) {
            e.printStackTrace();
            return new Result(true,"修改状态失败!");
        }
    }
}
